Functions | |
| template<typename T > | |
| span< T > | kanzi::gfx::allocateCommandBufferCommands (const CommandBufferHandleGuard &handle, uint32_t count) |
| Allocates typed command buffer memory. | |
| KANZI_GFX_API span< byte > | kanzi::gfx::allocateCommandBufferMemory (const CommandBufferHandleGuard &handle, uint32_t size) |
| Allocates raw memory into a command buffer. | |
| constexpr v2u32 | kanzi::gfx::calculateDimensionsForMip (v2u32 dims, uint8_t mip) |
| Calculates the dimensions of a 2-dimensional mip level. | |
| constexpr v3u32 | kanzi::gfx::calculateDimensionsForMip (v3u32 dims, uint8_t mip) |
| Calculates the dimensions of a 3-dimensional mip level. | |
| KANZI_GFX_API HandleGuard< BlendStateHandle > | kanzi::gfx::create (const BlendStateCreateInfo &info) |
| Creates a blend state graphics object. | |
| KANZI_GFX_API HandleGuard< BufferHandle > | kanzi::gfx::create (const BufferCreateInfo &info) |
| Creates a buffer graphics object. | |
| KANZI_GFX_API HandleGuard< CommandBufferHandle > | kanzi::gfx::create (const CommandBufferCreateInfo &info) |
| Creates a command buffer graphics object. | |
| KANZI_GFX_API HandleGuard< ComputePipelineHandle > | kanzi::gfx::create (const ComputePipelineCreateInfo &info) |
| Creates a compute pipeline graphics object. | |
| KANZI_GFX_API HandleGuard< ComputeResourceSetHandle > | kanzi::gfx::create (const ComputeResourceSetCreateInfo &info) |
| Creates a compute resource set graphics object. | |
| KANZI_GFX_API HandleGuard< DepthStencilStateHandle > | kanzi::gfx::create (const DepthStencilStateCreateInfo &info) |
| Creates a depth stencil state graphics object. | |
| KANZI_GFX_API HandleGuard< FrameBufferHandle > | kanzi::gfx::create (const FrameBufferCreateInfo &info) |
| Creates a frame buffer graphics object. | |
| KANZI_GFX_API HandleGuard< GpuFenceHandle > | kanzi::gfx::create (const GpuFenceCreateInfo &info) |
| Creates a GPU fence graphics object. | |
| KANZI_GFX_API HandleGuard< ImageHandle > | kanzi::gfx::create (const ImageCreateInfo &info) |
| Creates an image graphics object. | |
| KANZI_GFX_API HandleGuard< RasterStateHandle > | kanzi::gfx::create (const RasterStateCreateInfo &info) |
| Creates a raster state graphics object. | |
| KANZI_GFX_API HandleGuard< RenderPassHandle > | kanzi::gfx::create (const RenderPassCreateInfo &info) |
| Creates a render pass graphics object. | |
| KANZI_GFX_API HandleGuard< RenderPipelineHandle > | kanzi::gfx::create (const RenderPipelineCreateInfo &info) |
| Creates a render pipeline graphics object. | |
| KANZI_GFX_API HandleGuard< RenderResourceSetHandle > | kanzi::gfx::create (const RenderResourceSetCreateInfo &info) |
| Creates a render resource set graphics object. | |
| KANZI_GFX_API HandleGuard< SamplerHandle > | kanzi::gfx::create (const SamplerCreateInfo &info) |
| Creates a sampler graphics object. | |
| KANZI_GFX_API HandleGuard< ShaderHandle > | kanzi::gfx::create (const ShaderCreateInfo &info) |
| Creates a shader graphics object. | |
| KANZI_GFX_API HandleGuard< VertexInputStateHandle > | kanzi::gfx::create (const VertexInputStateCreateInfo &info) |
| Creates a vertex input state graphics object. | |
| KANZI_GFX_API ChannelType | kanzi::gfx::formatToChannelType (Format format) |
| Gets the channel encoding type for a graphics format. | |
| KANZI_GFX_API BackendInformation | kanzi::gfx::getBackendInformation () |
| Gets information about the current backend. | |
| KANZI_GFX_API v2u8 | kanzi::gfx::getBlockSize (Format format) |
| Gets the block size in pixels of a compressed format. | |
| KANZI_GFX_API uint32_t | kanzi::gfx::getBlockStride (Format format) |
| Gets the block stride in bytes for a compressed graphics format. | |
| KANZI_GFX_API uint32_t | kanzi::gfx::getChannelCount (Format format) |
| Gets the number of color and alpha channels in a graphics format. | |
| KANZI_GFX_API v4u8 | kanzi::gfx::getColorBits (Format format) |
| Gets the number of bits used to represent each color and alpha channel. | |
| KANZI_GFX_API v2u8 | kanzi::gfx::getDepthStencilBits (Format format) |
| Gets the number of bits used to represent each depth and stencil channel. | |
| KANZI_GFX_API uint32_t | kanzi::gfx::getDeviceProperty (DevicePropertyId property) |
| Gets the value of a property for the current device. | |
| uint8_t | kanzi::gfx::getFaceCount (gfx::ImageType type) |
| Gets the face count for a given resource type. | |
| KANZI_GFX_API AspectMask | kanzi::gfx::getFormatAspects (Format format) |
| Gets the aspect mask for a given graphics format. | |
| KANZI_GFX_API FormatFeatureFlag | kanzi::gfx::getFormatFeatures (Format format) |
| Gets device feature flags for a format for the current backend and device. | |
| KANZI_GFX_API AttachmentDescriptionSet | kanzi::gfx::getFrameBufferAttachmentDescriptionSet (const FrameBufferHandleGuard &handle) |
| Gets a default frame buffer attachment description set that is compatible with a frame buffer. | |
| KANZI_GFX_API size_t | kanzi::gfx::getImageSize (Format format, v3u32 dimensions) |
| Gets the size in bytes of an image with the specified format and dimensions. | |
| uint32_t | kanzi::gfx::getIndexBufferStride (IndexBufferType type) |
| Gets the stride in bytes of an index buffer type. | |
| KANZI_GFX_API uint32_t | kanzi::gfx::getPixelStride (Format format) |
| Gets the pixel stride in bytes for an uncompressed graphics format. | |
| constexpr ShaderFormatFamily | kanzi::gfx::getShaderFormatFamily (ShaderFormat format) |
| Gets the Shader format family for a given shader format. | |
| KANZI_GFX_API ObjectStatus | kanzi::gfx::getStatus (const RenderPipelineHandleGuard &handle) |
| Gets the status of a render pipeline graphics object. | |
| KANZI_GFX_API ObjectStatus | kanzi::gfx::getStatus (const ShaderHandleGuard &handle) |
| Gets the status of a shader graphics object. | |
| KANZI_GFX_API platform::SurfaceBits | kanzi::gfx::getSurfaceBitsFromFormat (Format color, Format depthStencil=Format::None) |
| Converts a color and depth stencil Format into a SurfaceBits structure. | |
| KANZI_GFX_API bool | kanzi::gfx::initialize (const InitializationInfo &info) |
| Initializes the Kanzi graphics library. | |
| KANZI_GFX_API bool | kanzi::gfx::isAlpha (Format format) |
| Returns whether a graphics format contains an alpha channel. | |
| KANZI_GFX_API bool | kanzi::gfx::isAstcHdrCompressed (Format format) |
| Returns whether a graphics format is ASTC HDR compressed. | |
| KANZI_GFX_API bool | kanzi::gfx::isColor (Format format) |
| Returns whether a graphics format contains a color channel. | |
| KANZI_GFX_API bool | kanzi::gfx::isCompressed (Format format) |
| Returns whether a graphics format is compressed. | |
| KANZI_GFX_API bool | kanzi::gfx::isDepth (Format format) |
| Returns whether a graphics format contains a depth channel. | |
| KANZI_GFX_API bool | kanzi::gfx::isFeatureEnabled (FeatureId feature) |
| Returns whether a graphics feature is supported by the current backend and device. | |
| KANZI_GFX_API bool | kanzi::gfx::isInitialized () |
| Returns whether the graphics library is initialized. | |
| KANZI_GFX_API bool | kanzi::gfx::isNativeTextureHandleTypeSupported (const gfx::NativeTextureHandle &handle) |
| Returns whether a native handle type for texture is supported by the current backend. | |
| KANZI_GFX_API bool | kanzi::gfx::isShaderFormatSupported (ShaderFormat format) |
| Returns whether a shader format is supported by the current backend and device. | |
| KANZI_GFX_API bool | kanzi::gfx::isSRGBEncoded (Format format) |
| Returns whether the color channels of a graphics format are sRGB-encoded. | |
| KANZI_GFX_API bool | kanzi::gfx::isStencil (Format format) |
| Returns whether a graphics format contains a stencil channel. | |
| KANZI_GFX_API span< byte > | kanzi::gfx::mapBuffer (const BufferHandleGuard &handle, uint32_t offset=0, uint32_t size=limits::MaxBufferSize) |
| Maps buffer memory into CPU-addressable memory for reading or writing. | |
| KANZI_GFX_API string | kanzi::gfx::outputCommandBuffer (DebugInformation &debugInformation, const CommandBufferHandleGuard &commandBuffer) |
| Outputs the contents of a command buffer into a string. | |
| KANZI_GFX_API span< const byte > | kanzi::gfx::peekCommandBufferMemory (const CommandBufferHandleGuard &handle) |
| Peeks at the currently allocated memory inside a command buffer. | |
| KANZI_GFX_API void | kanzi::gfx::processCommands (CommandBufferHandleGuard commands, TaskFn callback={}) |
| Notifies the backend to start processing the commands within a command buffer. | |
| KANZI_GFX_API void | kanzi::gfx::resetGpuFence (const GpuFenceHandleGuard &handle) |
| Resets the state of a GPU fence so that it can be used again. | |
| KANZI_GFX_API void | kanzi::gfx::shutdown () |
| Shuts down the graphics library. | |
| KANZI_GFX_API FixedString | kanzi::gfx::toFixedString (FilterMode filter) |
| Gets a string representation of a filter mode. | |
| KANZI_GFX_API string | kanzi::gfx::toString (DevicePropertyId propertyId) |
| Gets the device property identifier as a string. | |
| KANZI_GFX_API string | kanzi::gfx::toString (FeatureId feature) |
| Gets the Feature identifier as a string. | |
| KANZI_GFX_API string | kanzi::gfx::toString (ShaderFormat format) |
| Gets the shader format as a string. | |
| KANZI_GFX_API string | kanzi::gfx::toString (ShaderStage stage) |
| Gets the shader stage as a string. | |
| Format | kanzi::gfx::tryGetDepthStencilFromSurfaceBits (const platform::SurfaceBits &properties) |
| Matches a SurfaceBits structure to a depth stencil graphics format. | |
| Format | kanzi::gfx::tryGetFormatFromSurfaceBits (const platform::SurfaceBits &properties) |
| Matches a SurfaceBits structure to a graphics format. | |
| KANZI_GFX_API void | kanzi::gfx::unmapBuffer (const BufferHandleGuard &handle) |
| Unmaps buffer memory from CPU-addressable memory. | |
| KANZI_GFX_API void | kanzi::gfx::unmapBuffer (const BufferHandleGuard &handle, span< ByteRange > updatedRanges) |
| Unmaps buffer memory from CPU-addressable memory. | |
| KANZI_GFX_API void | kanzi::gfx::updateSurfaceDimensions (const FrameBufferHandleGuard &handle, v2u32 dimensions) |
| Updates the dimensions for a frame buffer that was created as an on-screen surface. | |
| template<typename T_Func > | |
| void | kanzi::gfx::visitCommands (const span< const byte > &commandMemory, T_Func &&func) |
| Traverses the command memory. | |
| KANZI_GFX_API WaitResult | kanzi::gfx::waitForGpuFence (const GpuFenceHandleGuard &handle, chrono::nanoseconds timeout) |
| Blocks the current thread until the GPU fence has been signaled or the timeout occurs. | |
The functions of the graphics libraries.
| KANZI_GFX_API string kanzi::gfx::outputCommandBuffer | ( | DebugInformation & | debugInformation, |
| const CommandBufferHandleGuard & | commandBuffer ) |
Outputs the contents of a command buffer into a string.
Used for debugging purposes to understand generated Kanzi graphics commands.
| debugInformation | A refrence to the DebugInformation interface. |
| commandBuffer | The command buffer to output. |
| KANZI_GFX_API bool kanzi::gfx::initialize | ( | const InitializationInfo & | info | ) |
Initializes the Kanzi graphics library.
You must call this function before all other graphics APIs.
| info | The graphics common initialization information. |
| KANZI_GFX_API void kanzi::gfx::shutdown | ( | ) |
Shuts down the graphics library.
When you call this function, make sure that:
| KANZI_GFX_API bool kanzi::gfx::isInitialized | ( | ) |
Returns whether the graphics library is initialized.
You can call this function from any thread.
| KANZI_GFX_API BackendInformation kanzi::gfx::getBackendInformation | ( | ) |
Gets information about the current backend.
You can call this function from any thread.
| KANZI_GFX_API bool kanzi::gfx::isShaderFormatSupported | ( | ShaderFormat | format | ) |
Returns whether a shader format is supported by the current backend and device.
You can call this function from any thread.
| format | The shader format. |
| KANZI_GFX_API bool kanzi::gfx::isNativeTextureHandleTypeSupported | ( | const gfx::NativeTextureHandle & | handle | ) |
Returns whether a native handle type for texture is supported by the current backend.
| handle | The native texture handle. |
| KANZI_GFX_API uint32_t kanzi::gfx::getDeviceProperty | ( | DevicePropertyId | property | ) |
Gets the value of a property for the current device.
These properties are fixed at runtime by the backend and the running device. You can call this function from any thread.
| property | The identifier of the device property. |
| KANZI_GFX_API bool kanzi::gfx::isFeatureEnabled | ( | FeatureId | feature | ) |
Returns whether a graphics feature is supported by the current backend and device.
You can call this function from any thread.
| feature | The identifier of the feature. |
| KANZI_GFX_API FormatFeatureFlag kanzi::gfx::getFormatFeatures | ( | Format | format | ) |
Gets device feature flags for a format for the current backend and device.
You can call this function from any thread.
| format | The image format. |
| KANZI_GFX_API AttachmentDescriptionSet kanzi::gfx::getFrameBufferAttachmentDescriptionSet | ( | const FrameBufferHandleGuard & | handle | ) |
Gets a default frame buffer attachment description set that is compatible with a frame buffer.
When creating an on-screen surface, there is no guarantee that the platform supports the requested format. The attachment description set returned by this function contains the format that the surface really uses. You can call this function from any thread.
| handle | The frame buffer handle. |
| KANZI_GFX_API void kanzi::gfx::updateSurfaceDimensions | ( | const FrameBufferHandleGuard & | handle, |
| v2u32 | dimensions ) |
Updates the dimensions for a frame buffer that was created as an on-screen surface.
Call this function to update the backend when the size of the surface changes. You can call this function from any thread.
| handle | The frame buffer handle. |
| dimensions | The window dimensions in pixels. |
| KANZI_GFX_API WaitResult kanzi::gfx::waitForGpuFence | ( | const GpuFenceHandleGuard & | handle, |
| chrono::nanoseconds | timeout ) |
Blocks the current thread until the GPU fence has been signaled or the timeout occurs.
The GPU fence is not automatically reset, which is why a second wait on a signaled fence always returns immediately. You can call this function from any thread.
| handle | The GPU fence handle. |
| timeout | The duration to wait before a timeout occurs. |
| KANZI_GFX_API void kanzi::gfx::resetGpuFence | ( | const GpuFenceHandleGuard & | handle | ) |
Resets the state of a GPU fence so that it can be used again.
You can call this function from any thread.
| handle | The GPU fence handle. |
| KANZI_GFX_API span< byte > kanzi::gfx::allocateCommandBufferMemory | ( | const CommandBufferHandleGuard & | handle, |
| uint32_t | size ) |
Allocates raw memory into a command buffer.
Once allocated, you must fill the buffer with command data before processing. It is recommended to use the typed helper function, see the allocateCommandBufferCommands function. You can call this function from any thread. It is unsupported to allocate memory from the same command buffer from multiple threads at the same time.
| handle | The command buffer handle. |
| size | The size of memory to allocate in bytes. |
| span< T > kanzi::gfx::allocateCommandBufferCommands | ( | const CommandBufferHandleGuard & | handle, |
| uint32_t | count ) |
Allocates typed command buffer memory.
This automatically initializes command data with the specified type. The type must be a graphics command type, or a composite type of only graphics commands. You can call this function from any thread. It is unsupported to allocate memory from the same command buffer from multiple threads at the same time.
| handle | The buffer handle. |
| count | The number of instances of the type to allocate. |
| T | The type to use to initialize the allocated memory. This can be a graphics command type or a composite type of only graphics commands. |
| KANZI_GFX_API void kanzi::gfx::processCommands | ( | CommandBufferHandleGuard | commands, |
| TaskFn | callback = {} ) |
Notifies the backend to start processing the commands within a command buffer.
This is an asynchronous operation and may not be complete when this function returns. The callback function is called on an undefined thread when the command processing is complete. You can call this function from any thread.
| commands | The command buffer to process. |
| callback | The callback function that is called when the processing is complete. |
| KANZI_GFX_API span< byte > kanzi::gfx::mapBuffer | ( | const BufferHandleGuard & | handle, |
| uint32_t | offset = 0, | ||
| uint32_t | size = limits::MaxBufferSize ) |
Maps buffer memory into CPU-addressable memory for reading or writing.
The buffer must be created with the CPUAccessFlag::Read or CPUAccessFlag::Write. Make sure that all calls to this function have a corresponding call to gfx::unmapBuffer. A buffer can have only one mapping at a time.
You can call this function from any thread with distinct buffer handles. Calls with the same buffer handle must be externally synchronized.
| handle | The buffer handle. |
| offset | The offset in bytes to map. |
| size | The size in bytes to map. The default is the rest of the buffer. |
| KANZI_GFX_API void kanzi::gfx::unmapBuffer | ( | const BufferHandleGuard & | handle | ) |
Unmaps buffer memory from CPU-addressable memory.
You can use this on a buffer that you mapped with the gfx::mapBuffer function.
This overload assumes that the entire mapped region has been modified. If you only modified a part of the mapped region, you can specify the ranges that were modified using the overload of this function that takes a span of ByteRange.
You can call this function from any thread with distinct buffer handles. Calls with the same buffer handle must be externally synchronized.
| handle | The buffer handle. is considered to have been updated. |
| KANZI_GFX_API void kanzi::gfx::unmapBuffer | ( | const BufferHandleGuard & | handle, |
| span< ByteRange > | updatedRanges ) |
Unmaps buffer memory from CPU-addressable memory.
You can use this on a buffer that you mapped with the gfx::mapBuffer function.
Only the memory ranges specified in the updatedRanges parameter are considered to have been modified.
You can call this function from any thread with distinct buffer handles. Calls with the same buffer handle must be externally synchronized.
| handle | The buffer handle. |
| updatedRanges | The ranges of the buffer that were updated. |
| KANZI_GFX_API HandleGuard< BufferHandle > kanzi::gfx::create | ( | const BufferCreateInfo & | info | ) |
Creates a buffer graphics object.
You can call this function from any thread.
| info | The initialization parameters. |
| KANZI_GFX_API HandleGuard< ImageHandle > kanzi::gfx::create | ( | const ImageCreateInfo & | info | ) |
Creates an image graphics object.
You can call this function from any thread.
| info | The initialization parameters. |
| KANZI_GFX_API HandleGuard< FrameBufferHandle > kanzi::gfx::create | ( | const FrameBufferCreateInfo & | info | ) |
Creates a frame buffer graphics object.
You can call this function from any thread.
| info | The initialization parameters. |
| KANZI_GFX_API HandleGuard< VertexInputStateHandle > kanzi::gfx::create | ( | const VertexInputStateCreateInfo & | info | ) |
Creates a vertex input state graphics object.
You can call this function from any thread.
| info | The initialization parameters. |
| KANZI_GFX_API HandleGuard< DepthStencilStateHandle > kanzi::gfx::create | ( | const DepthStencilStateCreateInfo & | info | ) |
Creates a depth stencil state graphics object.
You can call this function from any thread.
| info | The initialization parameters. |
| KANZI_GFX_API HandleGuard< BlendStateHandle > kanzi::gfx::create | ( | const BlendStateCreateInfo & | info | ) |
Creates a blend state graphics object.
You can call this function from any thread.
| info | The initialization parameters. |
| KANZI_GFX_API HandleGuard< RasterStateHandle > kanzi::gfx::create | ( | const RasterStateCreateInfo & | info | ) |
Creates a raster state graphics object.
You can call this function from any thread.
| info | The initialization parameters. |
| KANZI_GFX_API HandleGuard< RenderResourceSetHandle > kanzi::gfx::create | ( | const RenderResourceSetCreateInfo & | info | ) |
Creates a render resource set graphics object.
You can call this function from any thread.
| info | The initialization parameters. |
| KANZI_GFX_API HandleGuard< ComputeResourceSetHandle > kanzi::gfx::create | ( | const ComputeResourceSetCreateInfo & | info | ) |
Creates a compute resource set graphics object.
You can call this function from any thread.
| info | The initialization parameters. |
| KANZI_GFX_API HandleGuard< SamplerHandle > kanzi::gfx::create | ( | const SamplerCreateInfo & | info | ) |
Creates a sampler graphics object.
You can call this function from any thread.
| info | The initialization parameters. |
| KANZI_GFX_API HandleGuard< ShaderHandle > kanzi::gfx::create | ( | const ShaderCreateInfo & | info | ) |
Creates a shader graphics object.
You can call this function from any thread.
| info | The initialization parameters. |
| KANZI_GFX_API HandleGuard< ComputePipelineHandle > kanzi::gfx::create | ( | const ComputePipelineCreateInfo & | info | ) |
Creates a compute pipeline graphics object.
You can call this function from any thread.
| info | The initialization parameters. |
| KANZI_GFX_API HandleGuard< RenderPipelineHandle > kanzi::gfx::create | ( | const RenderPipelineCreateInfo & | info | ) |
Creates a render pipeline graphics object.
You can call this function from any thread.
| info | The initialization parameters. |
| KANZI_GFX_API HandleGuard< RenderPassHandle > kanzi::gfx::create | ( | const RenderPassCreateInfo & | info | ) |
Creates a render pass graphics object.
You can call this function from any thread.
| info | The initialization parameters. |
| KANZI_GFX_API HandleGuard< CommandBufferHandle > kanzi::gfx::create | ( | const CommandBufferCreateInfo & | info | ) |
Creates a command buffer graphics object.
You can call this function from any thread.
| info | The initialization parameters. |
| KANZI_GFX_API HandleGuard< GpuFenceHandle > kanzi::gfx::create | ( | const GpuFenceCreateInfo & | info | ) |
Creates a GPU fence graphics object.
You can call this function from any thread.
| info | The initialization parameters. |
| KANZI_GFX_API ObjectStatus kanzi::gfx::getStatus | ( | const ShaderHandleGuard & | handle | ) |
Gets the status of a shader graphics object.
You can call this function from any thread.
| handle | The shader handle. |
| KANZI_GFX_API ObjectStatus kanzi::gfx::getStatus | ( | const RenderPipelineHandleGuard & | handle | ) |
Gets the status of a render pipeline graphics object.
You can call this function from any thread.
| handle | The render pipeline handle. |
| KANZI_GFX_API span< const byte > kanzi::gfx::peekCommandBufferMemory | ( | const CommandBufferHandleGuard & | handle | ) |
Peeks at the currently allocated memory inside a command buffer.
You can call this function from any thread. You cannot allocate and peek at memory for the same command buffer from multiple threads at the same time.
| handle | The command buffer handle. |
| KANZI_GFX_API uint32_t kanzi::gfx::getPixelStride | ( | Format | format | ) |
Gets the pixel stride in bytes for an uncompressed graphics format.
| format | The graphics format. |
| KANZI_GFX_API uint32_t kanzi::gfx::getBlockStride | ( | Format | format | ) |
Gets the block stride in bytes for a compressed graphics format.
| format | The compressed graphics format. |
| KANZI_GFX_API uint32_t kanzi::gfx::getChannelCount | ( | Format | format | ) |
Gets the number of color and alpha channels in a graphics format.
| format | The graphics format. |
| KANZI_GFX_API bool kanzi::gfx::isColor | ( | Format | format | ) |
Returns whether a graphics format contains a color channel.
| format | The graphics format. |
| KANZI_GFX_API bool kanzi::gfx::isAlpha | ( | Format | format | ) |
Returns whether a graphics format contains an alpha channel.
| format | The graphics format. |
| KANZI_GFX_API bool kanzi::gfx::isDepth | ( | Format | format | ) |
Returns whether a graphics format contains a depth channel.
| format | The graphics format. |
| KANZI_GFX_API bool kanzi::gfx::isStencil | ( | Format | format | ) |
Returns whether a graphics format contains a stencil channel.
| format | The graphics format. |
| KANZI_GFX_API bool kanzi::gfx::isSRGBEncoded | ( | Format | format | ) |
Returns whether the color channels of a graphics format are sRGB-encoded.
| format | The graphics format. |
| KANZI_GFX_API bool kanzi::gfx::isCompressed | ( | Format | format | ) |
Returns whether a graphics format is compressed.
| format | The graphics format. |
| KANZI_GFX_API bool kanzi::gfx::isAstcHdrCompressed | ( | Format | format | ) |
Returns whether a graphics format is ASTC HDR compressed.
| format | The graphics format. |
| KANZI_GFX_API AspectMask kanzi::gfx::getFormatAspects | ( | Format | format | ) |
Gets the aspect mask for a given graphics format.
| format | The graphics format. |
| KANZI_GFX_API v4u8 kanzi::gfx::getColorBits | ( | Format | format | ) |
Gets the number of bits used to represent each color and alpha channel.
| format | The graphics format. |
| KANZI_GFX_API v2u8 kanzi::gfx::getDepthStencilBits | ( | Format | format | ) |
Gets the number of bits used to represent each depth and stencil channel.
| format | The graphics format. |
| KANZI_GFX_API v2u8 kanzi::gfx::getBlockSize | ( | Format | format | ) |
Gets the block size in pixels of a compressed format.
| format | The graphics format. |
| KANZI_GFX_API ChannelType kanzi::gfx::formatToChannelType | ( | Format | format | ) |
Gets the channel encoding type for a graphics format.
| format | The graphics format. |
| KANZI_GFX_API size_t kanzi::gfx::getImageSize | ( | Format | format, |
| v3u32 | dimensions ) |
Gets the size in bytes of an image with the specified format and dimensions.
| format | the graphics format. |
| dimensions | The image dimensions. |
|
inline |
Gets the stride in bytes of an index buffer type.
| type | The index buffer type. |
|
inline |
Gets the face count for a given resource type.
| type | Resource type. |
| KANZI_GFX_API FixedString kanzi::gfx::toFixedString | ( | FilterMode | filter | ) |
Gets a string representation of a filter mode.
| filter | The filter mode. |
Calculates the dimensions of a 2-dimensional mip level.
| dims | The original size of the image. |
| mip | The mip level whose dimensions to calculate. |
Calculates the dimensions of a 3-dimensional mip level.
| dims | The original size of the image. |
| mip | The mip level whose dimensions to calculate. |
|
inline |
Matches a SurfaceBits structure to a graphics format.
| properties | The surface bits description. |
|
inline |
Matches a SurfaceBits structure to a depth stencil graphics format.
Requires KzGfx to be initialized to query format support from target.
| properties | The surface bits description. |
| KANZI_GFX_API platform::SurfaceBits kanzi::gfx::getSurfaceBitsFromFormat | ( | Format | color, |
| Format | depthStencil = Format::None ) |
Converts a color and depth stencil Format into a SurfaceBits structure.
| color | The color format. Must be Format::None or an uncompressed format with color channels. |
| depthStencil | The depth stencil format. Must be Format::None or a format with either depth or stencil channels. |
|
constexpr |
Gets the Shader format family for a given shader format.
| format | The shader format. |
| KANZI_GFX_API string kanzi::gfx::toString | ( | ShaderStage | stage | ) |
Gets the shader stage as a string.
| stage | The shader stage. |
| KANZI_GFX_API string kanzi::gfx::toString | ( | DevicePropertyId | propertyId | ) |
Gets the device property identifier as a string.
| propertyId | The device property identifier. |
| KANZI_GFX_API string kanzi::gfx::toString | ( | FeatureId | feature | ) |
Gets the Feature identifier as a string.
| feature | The feature identifier. |
| KANZI_GFX_API string kanzi::gfx::toString | ( | ShaderFormat | format | ) |
Gets the shader format as a string.
| format | The shader format. |
Traverses the command memory.
| commandMemory | The command buffer memory. |
| func | The callback to call for each command. |
| T_Func | The function object called for every command, with the command as a reference argument. |